﻿using WMS.FC.Domain.DomainObject.System;

namespace WMS.FC.Domain.PersistenceObject.History
{
    /// <summary>
    /// 结果数据履历
    /// </summary>
    [SplitTable(TableName = "HIS_RESULT_DATA", TableDescription = "结果数据履历")]
    [SplitTableIndex("1", nameof(CreateDate), nameof(CellBarcode), false)]
    [SplitTableIndex("2", nameof(CreateDate), nameof(TechnologyRouteCode), false)]
    [SplitTableIndex("3", nameof(CreateDate), nameof(TechnologyProcessCode), false)]
    [SplitTableIndex("4", nameof(CreateDate), nameof(Step), false)]
    [SplitTableIndex("5", nameof(CreateDate), nameof(IsLastTest), false)]
    [SplitTableIndex("SEARCH", nameof(CreateDate), nameof(CellBarcode), nameof(TechnologyRouteCode), nameof(TechnologyProcessCode), nameof(Step), nameof(IsLastTest), false)]
    public class HisResultDataPO : HistoryPOBase
    {
        /// <summary>
        /// 电池条码
        /// </summary>
        [SplitTableColumn(ColumnName = "CELL_BARCODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "电池条码")]
        public string CellBarcode { get; set; } = string.Empty;

        /// <summary>
        /// 工艺路径编码
        /// </summary>
        [SplitTableColumn(ColumnName = "TECHNOLOGY_ROUTE_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "工艺路径编码")]
        public string TechnologyRouteCode { get; set; } = string.Empty;

        /// <summary>
        /// 工艺工序编码
        /// </summary>
        [SplitTableColumn(ColumnName = "TECHNOLOGY_PROCESS_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "工艺工序编码")]
        public string TechnologyProcessCode { get; set; } = string.Empty;

        /// <summary>
        /// 工步
        /// </summary>
        [SplitTableColumn(ColumnName = "STEP", ColumnDataType = "NUMBER(10)", IsNullable = true, ColumnDescription = "工步")]
        public int? Step { get; set; }

        /// <summary>
        /// 参数编码
        /// </summary>
        [SplitTableColumn(ColumnName = "PARAM_CODE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "参数编码")]
        public string ParamCode { get; set; } = string.Empty;

        /// <summary>
        /// 参数值
        /// </summary>
        [SplitTableColumn(ColumnName = "PARAM_VALUE", ColumnDataType = "VARCHAR2(50)", ColumnDescription = "参数值")]
        public string ParamValue { get; set; } = string.Empty;

        /// <summary>
        /// 是否最后一次测试值
        /// </summary>
        [SplitTableColumn(ColumnName = "IS_LAST_TEST", ColumnDataType = "NUMBER(1)", ColumnDescription = "是否最后一次测试值")]
        public bool IsLastTest { get; set; }
    }
}
